﻿#region zh-CHS 2006 - 2007 DemoSoft 团队 | en 2006 - 2007 DemoSoft Team

//     NOTES
// ---------------
//
// This file is a part of the G.O.S.E(Game Online Server Engine) for .NET.
//
//                 2006-2007 DemoSoft Team
//
//
// First Version : by H.Q.Cai - mailto:caihuanqing@hotmail.com

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

#region zh-CHS 包含名字空间 | en Include namespace
using System;
#endregion

namespace Demo_G.O.S.E.ServerEngine.Util
{
    public class RandomBuilder
    {
        #region zh-CHS 私有成员变量 | en Private Member Variables
        private static Random s_Seed = new Random();
        #endregion

        #region zh-CHS 公开的函数 | en Class Public Methods
        public static double RandomDouble()
        {
            return s_Seed.NextDouble();
        }

        public static int Random(int max)
        {
            return s_Seed.Next(max);
        }

        public static void Seed(int s)
        {
            s_Seed = new Random(s);
        }
        #endregion
    }
}
#endregion

